package icu.cocoon.work.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import icu.cocoon.dao.base.BaseService;
import icu.cocoon.work.entity.WeekContentItem;
import icu.cocoon.work.mapper.WeekContentItemMapper;
import icu.cocoon.work.service.WeekContentItemService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Cocoon
 * @since 2020-06-12
 */
@Service
public class WeekContentItemServiceImpl extends BaseService<WeekContentItemMapper, WeekContentItem> implements
    WeekContentItemService {

  @Override
  public List<WeekContentItem> findByWeekReportId(Long weekReportId) {
    Wrapper<WeekContentItem> wrapper =
        new QueryWrapper<WeekContentItem>().lambda().eq(WeekContentItem::getWeekReportId, weekReportId);
    return getMapper().selectList(wrapper);
  }

  @Override
  public void removeByWeekReportId(Long weekReportId) {
    Wrapper<WeekContentItem> wrapper =
        new QueryWrapper<WeekContentItem>().lambda().eq(WeekContentItem::getWeekReportId, weekReportId);
    getMapper().delete(wrapper);
  }

}
